package com.andy.myFramework.util;

import javax.servlet.http.HttpSession;

public class SessionUtil {

    private static ThreadLocal<HttpSession> currentSession;

    public static void setSession(HttpSession httpSession){
        currentSession.set(httpSession);
    }

    public static void setAttribute(String name, Object value){
        HttpSession httpSession = currentSession.get();
        httpSession.setAttribute(name,value);
    }

    public static Object getAttribute(String name){
        HttpSession httpSession = currentSession.get();
        return httpSession.getAttribute(name);
    }


}
